package cn.tedu.ximaet.order.webapi.service.impl;

import cn.tedu.ximaet.order.webapi.mapper.OrderMapper;
import cn.tedu.ximart.commons.pojo.order.vo.AccomplishListVO;
import cn.tedu.ximart.commons.pojo.order.vo.AwaitSendListVO;
import cn.tedu.ximart.commons.pojo.order.vo.AwaitTakeListVO;
import cn.tedu.ximart.commons.pojo.order.vo.OrderListVO;
import cn.tedu.ximart.order.service.IOrderService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@DubboService
@Slf4j
@Service
public class OrderServiceImpl implements IOrderService {
    @Autowired
    OrderMapper mapper;

    /**
     * 查询订单列表
     * @return 返回值为订单列表
     */
    @Override
    public List<OrderListVO> orderList() {
        log.info("开始查询订单列表");
        List<OrderListVO> orderList = mapper.orderList();
        log.info("即将向Controller返回订单列表>>>>>>>>>>{}",orderList);
        return orderList;
    }

    /**
     * 待发货列表
     * @return 返回值为待发货列表
     */
    @Override
    public List<AwaitSendListVO> awaitSendList() {
        log.info("开始查询待发货列表");
        List<AwaitSendListVO> awaitSendList = mapper.awaitSendList();
        log.info("即将向Controller返回待发货列表>>>>>>>>>>{}",awaitSendList);
        return awaitSendList;
    }

    /**
     * 待签收列表
     * @return 返回值为待签收列表
     */
    @Override
    public List<AwaitTakeListVO> awaitTakeList() {
        log.info("开始查询待签收列表");
        List<AwaitTakeListVO> awaitTakeList = mapper.awaitTakeList();
        log.info("即将向Controller返回待签收列表>>>>>>>>>>{}",awaitTakeList);
        return awaitTakeList;
    }

    /**
     * 已完成订单列表
     * @return 返回值为已完成订单列表
     */
    @Override
    public List<AccomplishListVO> AccomplishList() {
        log.info("开始查询已完成订单列表");
        List<AccomplishListVO> accomplishList = mapper.AccomplishList();
        log.info("即将向Controller返回已完成订单列表>>>>>>>>>>{}",accomplishList);
        return accomplishList;
    }

}
